from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Length, Optional


class LoginForm(FlaskForm):
    username = StringField('用户名', validators=[DataRequired(message='请填写用户名')],
                           render_kw={"placeholder": "请填写用户名"})
    password = PasswordField('密码', validators=[DataRequired(message='请填写密码'),
                                                 Length(6, 24, message='须在6～24个字符之间')])
    next_page = StringField('跳转地址', validators=[Optional()])
